﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RaytheonTimeDataModel
{
    public class ChargeNumberComparer : IEqualityComparer<ChargeNumber>
    {
        public int Compare(ChargeNumber x, ChargeNumber y)
        {
            return x.NetworkActivity.CompareTo(y.NetworkActivity);
        }

        public bool Equals(ChargeNumber x, ChargeNumber y)
        {
            return x.NetworkActivity.Equals(y.NetworkActivity);
        }

        public int GetHashCode(ChargeNumber obj)
        {
            return obj.NetworkActivity.GetHashCode();
        }
    }
    
    public partial class ChargeNumber
    {
        public String NetworkActivity
        {
            get
            {
                return this.network + ' ' + this.activity;
            }
        }

        public override string ToString()
        {
            return NetworkActivity;
        }

        public override bool Equals(object obj)
        {
            if (obj is ChargeNumber)
            {
                ChargeNumber param1 = (ChargeNumber)obj;
                return this.NetworkActivity.Equals(param1.NetworkActivity);
            }
            else if (obj is String)
            {
                String param1 = (String)obj;
                return this.NetworkActivity.Equals(param1);
            }
            else
            {
                return false;
            }
        }

        public override int GetHashCode()
        {
            return this.NetworkActivity.GetHashCode();
        }
    }
}
